package com.dtx.practice.two;


import java.util.*;

/**
 * Super:collection
 * Super:collection
 * Super:collection
 */
public class Demo01 {
    public static void main(String[] args) {
        Collection<?>[] collections  ={
                new HashSet<String>(),new ArrayList<String>()
                ,new HashMap<String,String>().values()
        };

        Super subToSuper = new Sub();

        for (Collection<?> collection : collections) {
            System.out.println(subToSuper.getType(collection));
        }
    }

    abstract static class Super{
        public static String getType(Collection<?> collection){
            return "Super:collection";
        }

        public static String getType(ArrayList<?> list){
            return "Super:arrayList";
        }

        public String getType(Set<?> set){
            return "Super:hashSet";
        }
    }

    static class Sub extends Super{
        public static java.lang.String getType(Collection<?> collection){
            return "Sub";
        }
    }
}

